package com.br.a3q.racha.user.client;

import com.extjs.gxt.ui.client.widget.Composite;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.Label;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.Widget;

public class InformationRachaForm extends Composite {

	public InformationRachaForm() {
		init();
	}

	protected void init() {
		ContentPanel contentPanel = new ContentPanel();
		contentPanel.setHeading("Racha");
		Grid grid = new Grid(3, 6);
		grid.setBorderWidth(0);
		contentPanel.add(grid);
		initComponent(contentPanel);

		// Linha 1
		Label name = new Label("<b>Nome:</b>");
		name.setStyleName("x-form-field");
		Label nameValue = new Label("Racha Mucuripe");
		nameValue.setStyleName("x-form-field");

		// Linha 2
		Label nameOwn = new Label("<b>Administrador:</b>");
		nameOwn.setStyleName("x-form-field");
		Label nameOwnValue = new Label("Claudemir");
		nameOwnValue.setStyleName("x-form-field");

		// Linha 3
		Label dateCreation = new Label("<b>Data de Criação:</b>");
		dateCreation.setStyleName("x-form-field");
		Label dateCreationValue = new Label("01/11/2011");
		dateCreationValue.setStyleName("x-form-field");

		Label numberRacha = new Label("<b>N° de Racha:</b>");
		numberRacha.setStyleName("x-form-field");
		Label numberRachaValue = new Label("10");
		numberRachaValue.setStyleName("x-form-field");

		Label qtdPlayers = new Label("<b>Qtd de Jogadores:</b>");
		qtdPlayers.setStyleName("x-form-field");
		Label qtdPlayersValue = new Label("40");
		qtdPlayersValue.setStyleName("x-form-field");

		Label status = new Label("<b>Status:</b>");
		status.setStyleName("x-form-field");
		Label statusValue = new Label("Ativo");
		statusValue.setStyleName("x-form-field");

		Label labelEmpty = new Label("");
		grid.setWidget(0, 0, name);
		grid.setWidget(0, 1, nameValue);
		grid.setWidget(1, 0, nameOwn);
		grid.setWidget(1, 1, nameOwnValue);
		grid.setWidget(2, 0, dateCreation);
		grid.setWidget(2, 1, dateCreationValue);

		grid.setWidget(0, 3, labelEmpty);
		grid.setWidget(1, 3, labelEmpty);
		grid.setWidget(2, 3, labelEmpty);

		grid.setWidget(0, 4, numberRacha);
		grid.setWidget(0, 5, numberRachaValue);
		grid.setWidget(1, 4, qtdPlayers);
		grid.setWidget(1, 5, qtdPlayersValue);
		grid.setWidget(2, 4, status);
		grid.setWidget(2, 5, statusValue);
	}

	@Override
	public Widget asWidget() {
		return new InformationRachaForm();
	}

}
